package models

import (
	"github.com/goravel/framework/database/orm"
)

type AdminLog struct {
	orm.Model
	ActionTime      string         `gorm:"column:action_time;type:datetime(3);not null;comment:'操作时间'" json:"action_time"`
	UserId          int            `gorm:"column:user_id;type:int;not null" form:"user_id" binding:"required"`
	UserName        string         `gorm:"column:user_name;type:varchar(255);not null;comment:'用户名'" json:"user_name"`
	StreamId        string         `gorm:"column:stream_id;type:varchar(255);not null;comment:'stream账号id'" json:"stream_id"`
	Command         string         `gorm:"column:command;type:varchar(255);not null;comment:'命令'" json:"command"`
	OriginalText    string         `gorm:"column:original_text;type:text;not null;comment:'原文'" json:"original_text"`
	ConfigurationID int            `gorm:"column:configuration_id;type:int;null" form:"configuration_id" json:"configuration_id"`
	Configuration   *Configuration `gorm:"foreignkey:ConfigurationID" form:"-" json:"-"`
}

func (*AdminLog) TableName() string {
	return "adminlogs"
}
